input[type=file]{
    display: block;
}
input[type=checkbox], input[type=radio]{
    margin: 0;
    margin-right: 5px;
    vertical-align: middle;
}
input[type=checkbox] + label, input[type=radio] + label{
    vertical-align: middle;
    cursor: pointer;
}
textarea.form-control{
    height: auto;
}
select.form-control{margin-bottom: 20px;}
.checkbox-group{
    input[type=checkbox]{
        display: none;
        & + label{
            width: @checkbox-width;
            height: @checkbox-width;
            border: solid 1px @input-border;
            display: inline-block;
            margin-right: 3px;
            position: relative;
        }
        &:checked + label:after{
            content: "\f00c";
            font-family: FontAwesome;
            font-size: 14px;
            position: absolute;
        }
    }
    label{
        vertical-align: middle;
        cursor: pointer;
    }
}
.radio-group{
    input[type=radio]{
        display: none;
        & + label{
            width: @checkbox-width;
            height: @checkbox-width;
            border: solid 1px @input-border;
            border-radius: 100%;
            display: inline-block;
            margin-right: 3px;
            position: relative;
        }
        &:checked + label:after{
            content: "";
            width: 8px;
            height: 8px;
            background: #000;
            display: inline-block;
            border-radius: 100%;
            position: absolute;
            left: 3px;
            top: 3px;
        }
    }
    label{
        position: relative;
        vertical-align: middle;
        cursor: pointer;
    }
}
.checkbox, .radio{
    margin-bottom: 10px;
}
.radio.disabled input, .radio.disabled label{cursor: @cursor-disabled; color: @input-border;}
.radio-inline, .checkbox-inline{
    display: inline-block;
    margin-bottom: 5px;
    margin-left: 5px;
    vertical-align: middle;
}
.sr-only {
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
    position: absolute;
}
.form-control-static{
    margin: 0;
    min-height: 35px;
    padding-top: 7px;
    padding-bottom: 7px;
}

.form-group{
    margin-bottom: 20px;
}

.form-title{
    margin-bottom: 10px;
    display: inline-block;
}
.form-control{
    width: 100%;
    height: 35px;
    line-height: 35px;
    font-size: 16px;
    background: #fff;
    border: solid 1px @input-border;
    padding: 0 10px;
    .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
    &[disabled], &[readonly]{
        background-color: @input-bg-disabled;
        opacity: 1;
    }
    &[disabled]{
        cursor: @cursor-disabled;
    }
    &:focus{
        border-color: @input-border-focus;
        outline: 0;
        @color-rgba: rgba(red(@input-border-focus), green(@input-border-focus), blue(@input-border-focus), .6);
        .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");  
    }
}
.form-horizontal{
    .form-group{
        &:before, &:after{
            content: "";
            display: table;
        }
        &:after{
            clear: both;
        }
    }
}
.input-group{
    width: 100%;
    display: table;
    .input-group-addon, .form-control{
        display: table-cell;
    }
    .input-group-addon{
        width: @input-addon-width;
        color: @input-border;
        border: solid 1px @input-border;
        text-align: center;
        &:first-child{border-right:0}
    }
}

.has-success{
    .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
}
.has-warning{
    .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
}
.has-error{
    .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
}

@media (min-width: @screen-sm-min){
select.form-control{margin-bottom: 0;}
 .form-inline{ 
    .form-group{
        margin-left: 20px;
        margin-bottom: 0;
        display: inline-block;
        vertical-align: middle;
        &:first-child{margin-left: 0;}
    }
    .form-control{
        width: auto;
        display: inline-block;
        vertical-align: middle;
    }
    .form-title{
        margin-bottom: 5px;
        vertical-align: middle;
    }
    .form-control-static{
        display: inline-block;
    }
}
.form-horizontal{
    .form-title{
        padding-top: 7px;
        margin-bottom: 0;
        text-align: right;
    }
}
}

.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5){
    .form-title, .checkbox{
        color: @text-color;
    }
    .form-control{
        border-color: @border-color;
        &:focus{
            border-color: darken(@border-color, 10%);
            @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
            .box-shadow(@shadow);
        }
    }
    .input-group-addon{
        color: @text-color;
        border-color: @border-color;
    }
}
.box-shadow(@shadow){
    -webkit-box-shadow: @shadow;
    box-shadow: @shadow;      
}
